package com.crm.service.impl.returnMoney;

import com.crm.dao.mapper.csd.customerManager.CustomerInfoMapper;
import com.crm.dao.mapper.customMapper.returnMoneyManagerCustomMapper.BankFlowWhiteCustomMapper;
import com.crm.dao.mapper.returnMoney.BankFlowWhiteListMapper;
import com.crm.model.entity.returnMoney.BankFlowWhiteList;
import com.crm.model.entity.returnMoney.BankFlowWhiteListExample;
import com.crm.model.vo.returnMoney.BankFlowWhiteVO;
import com.crm.service.returnMoney.BankFlowWhiteDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BankFlowWhiteDbServiceImpl implements BankFlowWhiteDbService {

    @Autowired
    BankFlowWhiteCustomMapper whiteCustomMapper;
    @Autowired
    BankFlowWhiteListMapper bankFlowWhiteListMapper;

    @Override
    public boolean queryExistWhiteListName(String whiteListName) {
        BankFlowWhiteListExample whiteListExample = new BankFlowWhiteListExample();
        whiteListExample.createCriteria().andWhiteListNameEqualTo(whiteListName);
        List<BankFlowWhiteList> bankFlowWhiteLists = bankFlowWhiteListMapper.selectByExample(whiteListExample);
        if(bankFlowWhiteLists!=null && bankFlowWhiteLists.size()>0){
            return true;
        }
        return false;
    }

    @Override
    public List<BankFlowWhiteVO> queryWhiteList() {
        return whiteCustomMapper.queryWhiteList();
    }
}
